import React from 'react';
import Loadable from 'react-loadable';
import { Skeleton } from 'antd';
export default function withLoadable (comp) {
	return Loadable({
		loader : comp,
		loading : props => {
			if (props.error) {
				return <div>error</div>;
			} else if (props.pastDelay) {
				return <Skeleton active />;
			} else {
				return null;
			}
		}
	});
}
